﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MapDownloader.Core.Models
{
    /// <summary>
    /// 从提供商获取的做原始瓦片的数据信息
    /// </summary>
    internal struct RawTile
    {
        public TilePoint Pos;
        public int Zoom;

        public RawTile(TilePoint Pos, int Zoom)
        {
            this.Pos = Pos;
            this.Zoom = Zoom;
        }

        public override string ToString()
        {
            return " zoom " + Zoom + ", pos: " + Pos;
        }
    }

    internal class RawTileComparer : IEqualityComparer<RawTile>
    {
        public bool Equals(RawTile x, RawTile y)
        {
            return x.Zoom == y.Zoom && x.Pos == y.Pos;
        }

        public int GetHashCode(RawTile obj)
        {
            return obj.Zoom ^ obj.Pos.GetHashCode();
        }
    }
}
